﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CP.Entities;
using CP.Repositories.GPM;
using CP.Utility;

namespace CP.Controllers.GPM
{
    public class SetRoleUserController
    {
        public IList<Department> GetAllDepartments()
        {
            DepartmentRepository rep = new DepartmentRepository();
            return rep.GetAllDepts();
        }

        public IList<User_Info> GetAllUsers()
        {
            UserInfoRepository rep = new UserInfoRepository();
            return rep.GetAllUsers();
        }

        public IList<User_Group> GetAllGroups()
        {
            UserGroupRepository rep = new UserGroupRepository();
            return rep.GetAllUserGroups();
        }

        public bool SetRoleUser(int groupid, IList<string> userids)
        {
            UserGroupRepository rep = new UserGroupRepository();
            return rep.InsertRoleUser(groupid, userids);
        }
    }
}
